package com.gitee.slowcreator.http.params;

import com.gitee.slowcreator.http.enums.RequestType;
import com.gitee.slowcreator.http.file.download.IFileDownload;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 注解参数放置到这 避免使用注解传输
 * 参数含义同 {@link com.gitee.slowcreator.http.annotation.HttpClient}
 *
 * @author zxw
 * @date 2023/1/25 下午1:53
 */
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class HttpClientParams {

    private String url;

    private RequestType requestType;

    private String charset;

    private String contentType;

    private boolean isMultipart;

    private boolean isAsync;

    private int timeout;

    @Deprecated
    private boolean download;

    @Deprecated
    private boolean downloadLocal;

    @Deprecated
    private String downloadLocalFilename;

    private HttpDownloadParams httpDownloadParams;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class HttpDownloadParams {

        private boolean download;

        private boolean useByte;

        private Class<? extends IFileDownload<?, ?>> fileDownloadHandle;
    }
}
